<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
    <title>Spring 3 MVC Series - Contact Manager | viralpatel.net</title>
</head>
<body>
 
<h2>Contact Manager</h2>
 
<form:form method="post" action="add.html" commandName="servicelist">
 
    <table>
    <tr>
        <td><form:label path="service_name"><spring:message code="label.service_name"/></form:label></td>
        <td><form:input path="service_name" /></td>
    </tr>
    <tr>
        <td><form:label path="service_price"><spring:message code="label.service_price"/></form:label></td>
        <td><form:input path="service_price" /></td>
    </tr>
    <tr>
        <td><form:label path="service_number"><spring:message code="label.service_number"/></form:label></td>
        <td><form:input path="service_number" /></td>
    </tr>
    <tr>
        <td colspan="2">
            <input type="submit" value="<spring:message code="label.addservicelist"/>"/>
        </td>
    </tr>
</table>  
</form:form>
 
     
<h3>Contacts</h3>
<c:if  test="${!empty servicelistList}">
<table class="data">
<tr>
    <th>Name</th>
    <th>Email</th>
    <th>Telephone</th>
    <th>&nbsp;</th>
</tr>
<c:forEach items="${servicelistList}" var="servicelist">
    <tr>
        <td>${servicelist.servier_name}</td>
        <td>${servicelist.service_price}</td>
        <td>${servicelist.service_number}</td>
        <td><a href="delete/${servicelist.id}">delete</a></td>
    </tr>
</c:forEach>
</table>
</c:if>
 
</body>
</html>